package cn.eric.framework.auth.dao.i;

import cn.eric.framework.auth.dao.UserDao;
import cn.eric.framework.auth.domain.User;
import org.springframework.orm.hibernate5.HibernateTemplate;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

@Repository
@Transactional
public class IUserDao implements UserDao {
    @Resource
    private HibernateTemplate hibernateTemplate;

    @Override
    public void save(User user) {
        hibernateTemplate.save(user);
    }

    @Override
    public User get(String uid) {
        return hibernateTemplate.get(User.class, uid);
    }
}
